﻿using Expect.Core.BaseClasses;
using Expect.Core.Interfaces;

namespace Expect.Core
{    
    /// <summary>
    /// Default implementation for ISpecificationContainer
    /// </summary>
    public abstract class AbstractSpecificationContainer : ISpecificationContainer
    {
        /// <summary>
        /// Suffix applyied to container class names
        /// </summary>
        public const string ContainerClassSuffix = "Container";

        /// <summary>
        /// Initialize the context
        /// </summary>
        public virtual void InitializeContext()
        {
            Context = new DefaultExecutionContext();
            Context.Container = this;
        }

        /// <summary>
        /// Method called before initializing tests
        /// </summary>
        public virtual void BeforeInit()
        {        
        }

        /// <summary>
        /// Method called after initializing tests
        /// </summary>
        public virtual void AfterInit()
        {        
        }

        /// <summary>
        /// Method called before Teardown
        /// </summary>
        public virtual void BeforeTeardown()
        {        
        }

        /// <summary>
        /// Method called after teardown
        /// </summary>
        public virtual void AfterTeardown()
        {
        }

        /// <summary>
        /// Execution context
        /// </summary>
        public IExecutionContext Context { get; set; }
    }
}
